package com.example.spingbootvue.service;

import com.example.spingbootvue.entity.User;
import com.example.spingbootvue.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class communityservice {

    @Autowired
    UserMapper userMapper;

    public int queryImage(String account,String image){
        User user=userMapper.queryImage(account,image);
        if(user==null){
            return userMapper.updateimage(account,image);
        }else {
            return 1;
        }
    }

    public int querySickName(String account,String sickname){
        User user=userMapper.querySickName(account,sickname);
        if(user==null){
            return userMapper.updateSickName(account,sickname);
        }else {
            return 1;
        }
    }

}
